package com.ssy.lingxi.order.model.vo.mobile.response;

import com.ssy.lingxi.common.constant.order.OrderSourceKindEnum;
import com.ssy.lingxi.order.model.constant.OrderOuterStatusEnum;
import com.ssy.lingxi.order.model.constant.OrderPromotionStatusEnum;
import com.ssy.lingxi.order.model.dto.MobileOrderQueryDTO;

import java.io.Serializable;

/**
 * “待发货订单” - 分页查询订单列表返回
 * @author 万宁
 * @version 2.0.0
 * @date 2021-09-24
 */
public class MobileToDeliveryOrderQueryVO extends MobileOrderQueryVO implements Serializable {
    private static final long serialVersionUID = 520900599365384374L;

    public MobileToDeliveryOrderQueryVO(MobileOrderQueryDTO query) {
        super(query);
        this.groupOrder = query.getOrderKind().equals(OrderSourceKindEnum.GROUP.getCode());
        this.groupId = query.getGroupId();
        this.promotionStatus = query.getPromotionStatus();
        this.promotionStatusName = OrderPromotionStatusEnum.getNameByCode(this.promotionStatus);
        this.showInvite = query.getOrderKind().equals(OrderSourceKindEnum.GROUP.getCode()) && query.getOuterStatus().equals(OrderOuterStatusEnum.TO_CONFIRM_DELIVERY.getCode()) && query.getPromotionStatus().equals(OrderPromotionStatusEnum.GROUP_WAITING_CONFIRM.getCode());
        this.showAfterSales = false;
    }

    /**
     * 是否是“拼团”订单
     */
    private Boolean groupOrder;

    /**
     * 拼团Id，如果不是“拼团订单”，此字段值为0
     */
    private Long groupId;

    /**
     * 是否显示“邀请好友拼团”按钮
     */
    private Boolean showInvite;

    /**
     * 营销活动（拼团）状态枚举，0-无营销活动，1-拼团中，2-等待拼团确认，3-拼团失败，4-拼团成功
     */
    private Integer promotionStatus;

    /**
     * 营销活动（拼团）状态名称
     */
    private String promotionStatusName;

    /**
     * 是否显示“售后”按钮
     */
    private Boolean showAfterSales;

    public Boolean getGroupOrder() {
        return groupOrder;
    }

    public void setGroupOrder(Boolean groupOrder) {
        this.groupOrder = groupOrder;
    }

    public Long getGroupId() {
        return groupId;
    }

    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }

    public Boolean getShowInvite() {
        return showInvite;
    }

    public void setShowInvite(Boolean showInvite) {
        this.showInvite = showInvite;
    }

    public Integer getPromotionStatus() {
        return promotionStatus;
    }

    public void setPromotionStatus(Integer promotionStatus) {
        this.promotionStatus = promotionStatus;
    }

    public String getPromotionStatusName() {
        return promotionStatusName;
    }

    public void setPromotionStatusName(String promotionStatusName) {
        this.promotionStatusName = promotionStatusName;
    }

    public Boolean getShowAfterSales() {
        return showAfterSales;
    }

    public void setShowAfterSales(Boolean showAfterSales) {
        this.showAfterSales = showAfterSales;
    }
}
